package lab3_2;

/**
 * <p>Title: Star class for Lab #3</p>
 * <p>Description: 
 *		Star 
 * 		The Star class stores information about small stars.
 * 		These stars are expected to be many times the mass of Jupiter
 * 		but smaller than the Sun.
 * 
 * 		Therefore, we will store the number of times a star is bigger than
 * 		Jupiter in an int data member and the fraction of the mass of the Sun
 * 		that the star mass is in a double data member.
 * </p>
 * 
 * @author tony
 * @date  10.01.2011
 * @email anthony.varghese@uwrf.edu
 * @version 3
 *
 */
public class Star implements Comparable<Star> {
	/**
	 * Data members
	 */
	private String name;
	private int jupiterMass;
	private double solarMass;
	
	/**
	 * Star constructor
	 * @param n
	 * @param j
	 * @param s
	 */
	public Star(String n, int j, double s){
		name        = n;
		jupiterMass = j;
		solarMass   = s;
	}
	/**
	 * Get and set methods
	 * @return
	 */
	public int getJMass(){ return jupiterMass; }
	public double getSMass(){ return solarMass; }
	
	
	/**
	 * toString method for displaying information as a String
	 */
	public String toString(){
		return " Star: " + name + 
		",    multiple of Jupiter mass: " + jupiterMass + 
		",    fraction of Sun mass: " + solarMass;
	}
	
	/**
	 * compareTo method to facilitate sorting.
	 */
	public int compareTo(Star o) {
		return name.compareTo( o.name );
	}

}
